<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>RVM : MMTk</title>
        <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>

    <body>
        <div id="page">
            <div id="main">
                <div id="main-header" class="pageSectionHeader">
                    <h1 id="title-heading" class="pagetitle">
                                                <span id="title-text">
                            RVM : MMTk
                        </span>
                    </h1>

                    <div class="page-metadata">
                        <p>This page last changed on Mar 07, 2011 by <font color="#0050B2">rgarner</font>.</p>
                    </div>
                </div>

                <div id="content" class="view">
                    <div id="main-content" class="wiki-content group">
                    <p>The garbage collectors for Jikes RVM are provided by MMTk. The <a href="http://cs.anu.edu.au/~Robin.Garner/mmtk-guide.pdf" class="external-link" rel="nofollow">MMTk: The Memory Manager Toolkit</a> describes MMTk and gives a tutorial on how to use and edit it and is the best place to start.  A detailed description of the call chain from the compilers through to MMTk <a href="Memory%2BAllocation%2Bin%2BJikesRVM.html">here</a> is another good place to start understanding how MMTk integrates with JikesRVM.</p>

<p>The RVM can be configured to employ various different allocation managers taken from the <a href="MMTk.html">MMTk</a> memory management toolkit. Managers divide the available space up as they see fit. However, they normally subdivide the available address range to provide:</p>
<ul>
	<li>a metadata area which enables the manager to track the status of allocated and unallocated storage in the rest of the heap.</li>
	<li>an immortal data area used to service allocations of objects which are expected to persist across the whole lifetime of the RVM runtime.</li>
	<li>a large object space used to service allocations of objects which are larger than some specified size (e.g. a virtual memory page) - the large object space may employ a different allocation and reclamation strategy to that used for other objects.</li>
	<li>a small object allocation area which may be divided into e.g.two semi spaces, a nursery space and a mature space, a set of generations, a non-relocatable buddy hierarchy etc depending upon the allocation and reclamation strategy employed by the memory manager.</li>
</ul>


<p>Virtual memory pages are lazily mapped into the RVM's memory image as they are needed.</p>

<p>The main class which is used to interface to the memory manager is called <code>Plan</code>. Each flavor of the manager is implemented by substituting a different implementation of this class. Most plans inherit from class <code>StopTheWorldGC</code> which ensures that all active mutator threads (i.e. ones which do not perform the job of reclaiming storage) are suspended before reclamation is commenced. The argument passed to <code>-X:processors</code> determines the number of parallel collector threads that will be used for collection.</p>

<p>Generational collectors employ a plan which inherits from class <code>Generational</code> Inter alia, this class ensures that a write barrier is employed so that updates from old to new spaces are detected.</p>

<p>The RVM does not currently support concurrent garbage collection.</p>

<p>Jikes RVM may also use the <a href="Using%2BGCSpy.html">GCSpy</a> visualization framework. GCSpy allows developers to observe the behavior of the heap and related data structures. </p>
                    </div>

                    
                 
                </div>             </div> 
            <div id="footer" style="background: url(http://docs.codehaus.org/images/border/border_bottom.gif) repeat-x;">
                <p><small>Document generated by Confluence on Feb 17, 2012 10:24</small></p>
            </div>
        </div>     </body>
</html>
